<template>
  <view class="wrap">
    <view class="backgroundFFF mt10">
      <view class="taskInfoBox">
        <view class="taskInfo">
          <view>任务年度：</view>
          <view> {{ taskInfo.taskYear }} </view>
        </view>
        <view class="taskInfo">
          <view>任务类型：</view>
          <view> {{ taskInfo.taskTypeName }} </view>
        </view>
        <view class="taskInfo">
          <view>任务标题：</view>
          <view> {{ taskInfo.taskTitle }} </view>
        </view>
        <view class="taskInfo">
          <view>任务内容：</view>
          <view>
            {{
              taskInfo.taskContent
            }}
          </view>
        </view>
      </view>
    </view>
    <view class="backgroundFFF mt10">
      <view class="taskInfoBox">
        <view class="taskInfo">
          <view>发起单位：</view>
          <view> {{ taskInfo.createOrgName ? taskInfo.createOrgName : '无'}} </view>
        </view>
        <view class="taskInfo">
          <view>发布时间：</view>
          <view> {{ taskInfo.createDate}} </view>
        </view>
        <view class="taskInfo">
          <view>牵头领导：</view>
          <view> {{ taskInfo.taskLeaderName ? taskInfo.taskLeaderName : '无' }}</view>
        </view>
        <view class="taskInfo">
          <view>牵头责任单位：</view>
          <view> {{ taskInfo.taskLeaderOrgName ? taskInfo.taskLeaderOrgName : '无'}}</view>
        </view>
      </view>
    </view>
	
	<!-- <div class="tableTitle"><span class="taskInfo">领导批示</span></div> -->
    <view class="backgroundFFF mt10">
		
      <view class="taskInfoBox">
		  <view class="taskInfo">
		    <span class="taskInfo blue" style="font-size: 15px;padding-bottom: 0px;">领导批示</span>
		  </view>
         <view  class="main" v-for="(item, i) in explains" :key="i">
			<view class="content" style="font-size: 15px;">
				<span class='time'>{{item.explainName}}</span>
				<span class='time1'>{{item.explainTime.slice(0,10)}}</span>
			 </view>
			<view>
			  <span class='word'>  {{
			     item.explainContent ? item.explainContent : '无'
			   }}</span>
		  </view>
        </view>
      </view>
    </view>
    <!-- 附件 -->
				<view class="lh-mt-36" style="margin-left:24rpx">
					<LhFilelist v-if="taskInfo.id" :bizKey="taskInfo.id" bizType="dcSupTaskInfo_file" />
				</view>
  </view>
</template>
<script>
/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
import LhFilelist from '@/components/lh-filelist/lh-filelist.vue';
export default {
  components: {
		LhFilelist
	},
  data() {
    return {
      taskInfo: {},
      ID:'',
      taskLeader:'',
	  explains:[],
    };
  },
  onLoad(options) {
    this.ID = options.id;
    this.taskLeader = options.taskLeader;
    if(this.ID){
      this.getDeail()
    }
  },
  onShow() {},
  methods: {
    getDeail(){
       this.$u.api.homePage.queryWorkList({id:this.ID,taskLeader:this.taskLeader}).then((res) => {
         
         this.taskInfo=res.list[0];
        for (var i = 0; i < res.list.length; i++) {
					if(res.list[i].taskStatus==2){
						res.list[i].taskStatusStr="已发布"
					}
					if(res.list[i].taskStatus==3){
						res.list[i].taskStatusStr="任务部署审核通过"
					}
					if(res.list[i].taskStatus==4){
						res.list[i].taskStatusStr="任务部署审核驳回"
					}
					if(res.list[i].taskStatus==5){
						res.list[i].taskStatusStr="秘书长审核通过"
					}
					if(res.list[i].taskStatus==6){
						res.list[i].taskStatusStr="秘书长审核驳回"
					}
					if(res.list[i].taskStatus==7){
						res.list[i].taskStatusStr="已确认"
					}
					if(res.list[i].taskStatus==8){
						res.list[i].taskStatusStr="进行中"
					}
					if(res.list[i].taskStatus==9){
						res.list[i].taskStatusStr="已结束"
					}
				}
				// 查询历史批示
				this.$u.api.homePage.queryExplainList({actionId:res.list[0].id}).then((res) => {
					this.explains = res;
				});
      });
    }
  },
};
</script>
<style lang="scss">
	.time{
		color: #999999;
		
	}
	.time1{
		font-size: 14px;
			color: #999999;
	}
	.content{
		justify-content: space-between;
		flex-direction:row ;
		font-size: 18px;
		font-weight: 500;
		margin-bottom: 5px;

		
	}
	.word{
		word-wrap:break-word;
		font-weight: 500;
	
		
	}
	.blue{
		color: #1a73e8;
		font-size: 18px;
	}
	.main{
		border-bottom: 1px solid #e0e0e0;
		margin: 10px 5px;
		padding-bottom: 5px;
	}
page {
  background-color: #f8f8f8;
}
.btn-plus {
  position: absolute;
  bottom: 50rpx;
  right: 50rpx;
  z-index: 1;
  opacity: 0.6;
}
.btn-plus:hover {
  opacity: 1;
}
.taskInfoBox {
  margin-right: 24rpx;
  margin-left: 24rpx;
  & > view:last-child {
    border: none;
  }
  .taskInfoTit {
    height: 85rpx;
    line-height: 85rpx;
  }
}
.tableTitle {
    color: royalblue;
  }
.midText {
    left: 10%;
	font-style: italic;
    transform: translateX(-50%) translateY(-50%);
  }
</style>
